package com.hzlj.position.locate.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fz.common.base.converter.QueryWrapperConverterPlus;
import com.fz.common.base.dto.PageParamDTO;
import com.fz.common.base.dto.QueryPageResultDTO;
import com.hzlj.position.locate.common.dto.position.PositionQueryParamDTO;
import com.hzlj.position.locate.common.dto.positionSkynet.PositionSkynetQueryResultDTO;
import com.hzlj.position.locate.common.model.PositionSkynet;
import com.hzlj.position.locate.mapper.PositionSkynetMapper;
import com.hzlj.sqjz.jz.common.constant.JzJoin;
import com.hzlj.sqjz.jz.common.model.JzJbxx;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * 定位记录-天网(PositionSkynet)表操作类
 *
 * @author lifh
 * @date 2023-03-31 11:05:37
 */
@Repository
public class PositionSkynetDao extends ServiceImpl<PositionSkynetMapper, PositionSkynet> {
    @Resource
    private PositionSkynetMapper positionSkynetMapper;

    /**
     * 查询列表：不分页
     *
     * @param dto 查询条件
     * @return 对象列表
     */
    public List<PositionSkynetQueryResultDTO> listPositionSkynet(PositionQueryParamDTO dto) {
        return QueryWrapperConverterPlus.of(positionSkynetMapper)
                .innerJoin(JzJbxx.class, JzJoin.jz(PositionSkynet::getJzId))
                .list(PositionSkynetQueryResultDTO.class, dto);
    }


    /**
     * 查询列表：分页
     *
     * @param dto 查询条件
     * @param page 分页信息
     * @return 对象列表
     */
    public QueryPageResultDTO<PositionSkynetQueryResultDTO> pagePositionSkynet(PositionQueryParamDTO dto, PageParamDTO page){
        return QueryWrapperConverterPlus.of(positionSkynetMapper)
                .innerJoin(JzJbxx.class, JzJoin.jz(PositionSkynet::getJzId))
                .page(PositionSkynetQueryResultDTO.class, dto, page);
    }
}

